<?php
/**
 * @description:
 * @author sunnyw<iwisunny@gmail.com>
 */
class Group_model extends MY_Model
{

    protected $_table='groups';
    protected $soft_delete_key='is_delete';
    protected $return_type='array';
    protected $soft_delete=true;

    function __construct()
    {
        parent::__construct();
    }

    function get_group_list(){
        $query=$this->db->select('gid,label,label_zh')
            ->get($this->_table);

        $res=$query->result_array();

        if(!empty($res)){
            $ret=[];
            foreach($res as $row){
                $ret[$row['gid']]=$row;
            }
            return $ret;
        }

        return $res;
    }
}
